"""
电商数据库建模

"""

from django.db import models


# Create your models here.
class Goods(models.Model):
    g_id = models.CharField(max_length=32)   # 商品编号
    g_name = models.CharField(max_length= 128)    # 商品名称
    g_price = models.FloatField()    # 商品价格
    g_old_price = models.FloatField()   # 商品原价
    g_period = models.DateField()    # 生产日期
    g_shelf = models.CharField(max_length = 32)    # 保质期
    g_description = models.TextField()    # 商品描述
    g_picture = models.CharField(max_length=32)    # 商品图片
    g_quantity = models.IntegerField()    # 商品数量
    g_types = models.CharField(max_length=32)    # 商品类型
    g_owned = models.CharField(max_length=32)    # 所属店铺


class User(models.Model):
    username = models.CharField(max_length = 32)
    passworld = models.CharField(max_length = 32)

class UserInfo(models.Model):
    nick_name = models.CharField(max_length = 32)
    u_user = models.OneToOneField(to= User, on_delete = models.CASCADE)

